<?php

declare(strict_types=1);

namespace App\Entity;

use App\Models\HomepageCombo;

class HomepageComboEntity extends ABaseEntity
{
    public $text1          = '';
    public $text2          = '';
    public $text3          = '';
    public $text4          = '';
    public $text5          = '';
    public $image1         = '';
    public $image2         = '';
    public $image3         = '';
    public $image4         = '';
    public $image5         = '';
    public $link_url       = '';
    public $city_id        = 0;
    public $sort_weight    = 0;
    public $hidden         = 0;
    public $start_datetime = 0;
    public $end_datetime   = 0;
    public $origin_price   = 0.0;
    public $lower_price    = 0.0;

    public function __construct(HomepageCombo $model)
    {
        $this->model = $model;
    }

    public function getId(): int
    {
        return $this->model->id ?? 0;
    }

    public function getText(int $no): string
    {
        $textName = 'text' . $no;

        return $this->model->{$textName};
    }

    public function getImage(int $no): string
    {
        $imageName = 'image' . $no;

        return $this->model->{$imageName};
    }

    public function getLinkUrl(): string
    {
        return $this->model->link_url;
    }

    public function getCityId(): int
    {
        return $this->model->city_id;
    }

    public function getSortWeight(): int
    {
        return $this->model->sort_weight;
    }

    public function getHidden(): int
    {
        return $this->model->hidden;
    }

    public function getStartDatetime(): int
    {
        return $this->model->start_datetime;
    }

    public function getEndDatetime(): int
    {
        return $this->model->end_datetime;
    }

    public function getOriginPrice()
    {
        return $this->model->origin_price;
    }

    public function getLowerPrice()
    {
        return $this->model->lower_price;
    }

    public function setText(int $no, string $val): void
    {
        $textName                 = 'text' . $no;
        $this->model->{$textName} = $val;
    }

    public function setImage(int $no, string $val): void
    {
        $imageName                 = 'image' . $no;
        $this->model->{$imageName} = $val;
    }

    public function setLinkUrl(string $val): void
    {
        $this->model->link_url = $val;
    }

    public function setCityId($val): void
    {
        $this->model->city_id = intval($val);
    }

    public function setSortWeight($val): void
    {
        $this->model->sort_weight = intval($val);
    }

    public function setHidden($val): void
    {
        $this->model->hidden = $val;
    }

    public function setStartDatetime($val): void
    {
        $this->model->start_datetime = intval($val);
    }

    public function setEndDatetime($val): void
    {
        $this->model->end_datetime = intval($val);
    }

    public function setOriginPrice($val): void
    {
        $this->model->origin_price = floatval($val);
    }

    public function setLowerPrice($val): void
    {
        $this->model->lower_price = floatval($val);
    }
}
